/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package au.edu.swin.unilearn.students;

import au.edu.swin.unilearn.subject.Subject;
import au.edu.swin.unilearn.submission.Submission;
import au.edu.swin.unilearn.tutorialGroup.TutorialGroup;
import java.io.Serializable;
import java.util.List;

/**
 *
 * @author DidierLeung
 */
public class Student implements Serializable
{
    private String id;
    private String name;
    private String password;
    private List<Submission> submissionCollection;
    private List<TutorialGroup> tutorialGroupCollection;

    public Student(String id, String name, String password, 
                            List<TutorialGroup> tutorialGroup, 
                                List<Submission> submissionCollection) 
    {
        this.id = id;
        this.name = name;
        this.password = password;
        this.tutorialGroupCollection = tutorialGroupCollection;
        this.submissionCollection = submissionCollection;
    }

    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public List<Submission> getSubmissionCollection()
    {
        return submissionCollection;
    }

    public void setSubmissionCollection(List<Submission> submissionCollection)
    {
        this.submissionCollection = submissionCollection;
    }

    public Boolean isStudentID(String StudentId)
    {
        return (this.id).equals(StudentId);
    }

    public List<TutorialGroup> getTutorialGroupCollection()
    {
        return tutorialGroupCollection;
    }

    public void setTutorialGroupCollection(List<TutorialGroup> tutorialGroupCollection)
    {
        this.tutorialGroupCollection = tutorialGroupCollection;
    }
    
    public Integer getTutorialGroupNo(String subjectCode)
    {
        for(TutorialGroup tg : tutorialGroupCollection)
        {
            Subject s = tg.getSubject();
            if(subjectCode.equals(subjectCode))
            {
                return tg.getActivity_no();
            }
        }
        return null;
    }
}
